package com.mall.module.system.service;

import com.github.pagehelper.PageInfo;
import com.mall.module.system.domain.dto.RoleAuthDTO;
import com.mall.module.system.domain.dto.RoleCreateDTO;
import com.mall.module.system.domain.dto.RoleUpdateDTO;
import com.mall.module.system.domain.entity.SysRole;
import com.mall.module.system.domain.entity.SysUser;
import com.mall.module.system.domain.vo.PermissionTreeVO;

import java.util.List;
import java.util.Set;

/**
 * 角色服务接口
 */
public interface SysRoleService {
    
    /**
     * 获取用户角色标识集合
     * 
     * @param userId 用户ID
     * @return 角色标识集合
     */
    Set<String> getRolesByUserId(Long userId);

    PageInfo<SysRole> listRoles(int pageNum, int pageSize, String roleName, Integer status);

    SysRole getRoleById(Long roleId);

    boolean createRole(RoleCreateDTO dto);

    boolean updateRole(Long roleId, RoleUpdateDTO dto);

    boolean deleteRole(Long roleId);

    boolean updateRoleStatus(Long roleId, Integer status);

    boolean assignRoleMenus(Long roleId, List<Long> menuIds);

    boolean assignRolePermissions(Long roleId, List<Long> permissionIds);

    List<Long> getRoleMenuIds(Long roleId);

    List<Long> getRolePermissionIds(Long roleId);

    List<SysUser> getRoleUsers(Long roleId);

    boolean assignUsersToRole(Long roleId, List<Long> userIds);

    PermissionTreeVO getRolePermissionTree(Long roleId);

    PermissionTreeVO getFullPermissionTree();

    Boolean assignRoleAuthorizations(Long roleId, RoleAuthDTO dto);
}